package com.example.springboot.mapper;

import com.example.springboot.entity.DrugClassification;
import com.example.springboot.entity.DrugDetails;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface DrugMapper {
    List<DrugClassification> selectDrugClassificationAll(DrugClassification drugClassification);

    @Select("select * from drug_classification where name = #{name}")
    DrugClassification selectByDrugClassificationName(String name);

    void insertDrugClassification(DrugClassification drugClassification);

    void updateDrugClassificationById(DrugClassification drugClassification);

    @Delete("delete from drug_classification where id = #{id}")
    void deleteDrugClassificationById(Integer id);

    List<DrugDetails> selectDrugDetailsAll(DrugDetails drugDetails);

    @Select("select * from drug_details where name = #{name}")
    DrugDetails selectByDrugDetails(String name);

    void insertDrugDetails(DrugDetails drugDetails);

    void updateDrugDetails(DrugDetails drugDetails);
}
